<?php
	include "./inc/output.php";

	
	mysql_connect() or die ("Connection to the guilt database has failed. Sorry.");
	mysql_select_db("guild");
	$sql = "SELECT users.id, users.username, frags.kills, frags.killed, frags.frags FROM frags RIGHT OUTER JOIN users ON frags.uid = users.id ORDER BY frags DESC, kills DESC;";
	$res = mysql_query($sql);
	
	$cols = Array("id","codename","kills","killed","frags");
	$classes = Array(1 => "codename");
	
	outputClear();
	outputTag("h2","Frags");
	outputSQLTable($res, $cols, "rowClassed", $classes);
	outputTag("a", Array("class" => "triplet button", "id" => "update"), "Update");
	
	outputRaw("<script language=\"JavaScript\">");
	outputFile("scriptlets/frags_update.js");
	outputRaw("</script>");
	output();
?>